<style lang="less" scoped>
  @import '~@/theme/index.less';
.nav_list-readall {
  position: fixed;
  z-index: 2;
  bottom: 160px;
  right: 80px;
  background: #536dfe;
  border-radius: 50%;
  width: 100px;
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 44px;
  z-index: 100;
  &:active {
    background: #3c56e3;
  }
}
.notice-detail {
  // width: 100%;
  // height: 100%;
  // background: #f8f8f8;
  .notice-outer {
    // position: absolute;
    // left: 5px;
    // right: 5px;
    // top: 10px;
    // bottom: 10px;
    padding: 100px 10px 5px 10px;
    li {
      display: flex;
      span {
        width: 25%;
        display: block;
        font-size: 28px;
        font-weight: 400;
        color: rgba(169, 171, 169, 1);
        line-height: 40px;
      }
      div {
        font-size: 28px;
        font-weight: 400;
        color: rgba(63, 63, 63, 1);
        line-height: 40px;
        width: 100%;
        text-align: justify;
      }
    }
  }
}
</style>
<template>
  <div class="notice-detail">
    <Header title="通知详情">
   </Header>
    <div class="notice-outer">
      <ul>
        <!-- <li><div v-html="currentItem.USERMSG_NR" /></li> -->
        <li>
          <span>标题：</span>
          <div>{{ noticeItem.USERMSG_BT }}</div>
        </li>
        <li>
          <span>内容：</span>
          <div v-html="noticeItem.USERMSG_NR" />
        </li>
        <li>
          <span>发送人：</span>
          <div>{{ noticeItem.SY_CREATEUSERNAME }}</div>
        </li>
        <li>
          <span>时间：</span>
          <div>{{ noticeItem.SY_CREATETIME }}</div>
        </li>
      </ul>
    </div>
  </div>
</template>
<script>
import Code from '../../class/Code';
import Header from '@/components/header';

export default {
  name: 'noticeDetail',
  components: {
    Header,
  },
  data() {
    return {
      noticeItem: {}
    }
  },
  created() {
    const that=this;
    const {id} = this.$route.query;
    Code.getInfoById({tableCode:"JE_SYS_USERMSG",pkValue:id}).then((data)=>{
      // that.noticeItem.USERMSG_NR = data.USERMSG_NR;
      // that.noticeItem.USERMSG_BT = data.USERMSG_BT;
      // that.noticeItem.SY_CREATEUSERNAME=data.SY_CREATEUSERNAME;
      // that.noticeItem.JE_SYS_USERMSG_ID=data.JE_SYS_USERMSG_ID;
      that.$set(that.noticeItem, 'JE_SYS_USERMSG_ID',data.JE_SYS_USERMSG_ID);
      that.$set(that.noticeItem, 'USERMSG_NR',data.USERMSG_NR);
      that.$set(that.noticeItem, 'SY_CREATEUSERNAME',data.SY_CREATEUSERNAME);
      that.$set(that.noticeItem, 'SY_CREATETIME',data.SY_CREATETIME);
      that.$set(that.noticeItem, 'USERMSG_BT',data.USERMSG_BT);
      if(data.USERMSG_YD == '0'){
        that.init();
      }
    });
    // const { item,title } = this.$route.query;
    // this.title = title;
    // this.noticeItem = item;
    // const currentWeb = plus.webview.currentWebview()
    // this.currentItem = currentWeb.noticeItem
    // const newValue = this.currentItem.USERMSG_NR.replace(/<\/?.+?>/g, '')
    // this.bottom_list = this.currentItem.USERMSG_APPINFO
    //   ? JSON.parse(this.currentItem.USERMSG_APPINFO)
    //   : ''
    // this.$set(this.currentItem, 'USERMSG_NR', newValue)
    // console.log('dy', this.currentItem)
  },
  mounted() {
    // 处理已读内容
    // this.init();
  },
  methods: {
    async init() {
      if (Object.keys(this.noticeItem).length) {
        const params = {
          tableCode: 'JE_SYS_USERMSG',
          JE_SYS_USERMSG_ID: this.noticeItem.JE_SYS_USERMSG_ID,
          USERMSG_YD: '1',
        }
        // 消息角标数量发送监听
        await Code.getNoticeReads(params)
      }
    },
  },
}
</script>
